<ion-view view-title="忘记密码" hide-nav-bar="true">

  <ion-header-bar align-title="center" class="bar-calm">
    <div class="buttons">
      <button class="button head-button button-clear center-btn" ng-click="goBack()">
        <img src="img/order-commit/backIcon.png">
      </button>
    </div>
    <h1 class="title">忘记密码</h1>
  </ion-header-bar>

  <ion-content id="register">
    <div class="notice" ng-if="showNotice">
        短信验证码已发送
    </div>
    <!-- 为了与注册页面保持一直结构,复用样式-->
    <div ng-form="fpForm" class="list">
      <div class="item item-input">
        <input type="text" name="phone"
               ng-model="regData.mobile"
               ng-required="true"
               ng-pattern="/^0?(13[0-9]|15[012356789]|17[678]|18[0-9]|14[57])[0-9]{8}$/"
               placeholder="请输入手机号码">
        <button class="button button-clear" style="position: absolute;right:5px;bottom:2px;border-radius:5px"
                ng-class="remainTime < 1 ? 'get-valid-code-on':'get-valid-code-off'"
                ng-disabled="fpForm.phone.$invalid || remainTime > 0"
                ng-click="getVerifyCode()">
          <span ng-if="remainTime < 1">
            获取验证码
          </span>
          <span ng-if="remainTime > 0">
            {{remainTime}}秒
          </span>
        </button>
      </div>

      <div class="item item-input">
        <input type="text" name="phoneValid"
               ng-model="regData.pwdcode"
               ng-pattern="/^\d{4}$/"
               ng-required="true"
               placeholder="输入4位验证码">
        <button class="button button-clear button-stable not-receive" ng-click="cantReceive()">
          没有收到?
        </button>
      </div>

        <div class="item item-input">
            <input type="password" name="password"
                   ng-model="regData.password"
                   ng-required="true"
                   placeholder="请输入由6-16位英文字母或数字组成的密码">
        </div>

        <div class="item item-input">
            <input type="password" name="confirm"
                   ng-model="regData.confirm"
                   ng-required="true"
                   placeholder="请您再次确认您的密码">
        </div>

      <div class="register-container">
        <button class="button register button-clear"
                ng-disabled="fpForm.$invalid"
                ng-click="register()">
            立即登陆
          <div ng-if="processing" class="spinner">
            <ion-spinner icon="circles" class="spinner-stable"></ion-spinner>
          </div>
        </button>
      </div>
    </div>
    <div class="bottom-blank"></div>
  </ion-content>
</ion-view>
